package com.example.qxfw.dataBaseManager.nyzjk.service.impl;

import com.example.qxfw.common.entity.ny.CropDistIndex;
import com.example.qxfw.common.mapper.CropDistIndexMapperXml;
import com.example.qxfw.common.mapper.StationInfoMapperXml;
import com.example.qxfw.dataBaseManager.nyzjk.service.DiseaseAndPestPredictionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/************************************
 *
 * @author : HuangDeYin Jolly
 * @since : JDK 11
 * @Date : 2023/7/5  星期三   11:07
 * @description : 此类用来
 ***************************************/
@Service
public class DiseaseAndPestPredictionServiceImpl implements DiseaseAndPestPredictionService {

    @Autowired
    private CropDistIndexMapperXml cropDistIndexMapperXml;

    @Autowired
    private StationInfoMapperXml stationInfoMapperXml;
    @Override
    public List<CropDistIndex> selectByCropName() {
        List<CropDistIndex> cropDistIndices = this.cropDistIndexMapperXml.selectOrderByCropName();
        return cropDistIndices;
    }

    @Override
    public List<CropDistIndex> getCropDistIndex() {
        List<CropDistIndex> cropDistIndex = this.cropDistIndexMapperXml.getCropDistIndex();
        return cropDistIndex;
    }

    @Override
    public List<CropDistIndex> selectByCropNameAndDisdesesName(final String cropName, final String DiseasesName) {
        List<CropDistIndex> cropDistIndexList = this.cropDistIndexMapperXml.selectByCropNameAndDisdesesName(cropName, DiseasesName);
        return cropDistIndexList;
    }

    @Override
    public List<CropDistIndex> selectByStartTimeAndEndTime(final String startTime, final String endTime) {
        List<CropDistIndex> cropDistIndices = this.cropDistIndexMapperXml.selectByStartTimeAndEndTime(startTime, endTime);
        return cropDistIndices;
    }

    @Override
    public List<CropDistIndex> selectByCropNameAndDisdesesNameNoOrder(final String cropName, final String DiseasesName) {
        List<CropDistIndex> cropDistIndexList = this.cropDistIndexMapperXml.selectByCropNameAndDisdesesNameNoOrder(cropName, DiseasesName);
        return cropDistIndexList;
    }

    @Override
    public Integer insertCropDistIndex(final CropDistIndex cropDistIndex) {
        Integer insertCropDistIndex = this.cropDistIndexMapperXml.insertCropDistIndex(cropDistIndex);
        return insertCropDistIndex;
    }

    @Override
    public Integer deleteByCropNameAndDisdesesName(final String cropName, final String diseasesName) {
       return this.cropDistIndexMapperXml.deleteByCropNameAndDisdesesName(cropName, diseasesName);
    }

    @Override
    public Integer updateByCropNameAndDisdesesName(final CropDistIndex cropDistIndex) {
        return this.cropDistIndexMapperXml.updateByCropNameAndDisdesesName(cropDistIndex);
    }

    @Override
    public Integer clearCropDistIndex() {
        return this.cropDistIndexMapperXml.clearCropDistIndex();
    }

    @Override
    public List<CropDistIndex> selectAll() {
        return this.cropDistIndexMapperXml.selectAll();
    }
}
